<!-- 默认首页 -->
<template>
  <div class="index-page">
    <Notice/>
    <el-carousel style="margin-top: 5px">
      <el-carousel-item v-for="item in dataList" :key="item.id">
        <img  style="width: 100%; height: 300px" :src="item.picUrl">
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dataList: []
    }
  },
  mounted() {
    this.getDataList()
  },
  methods: {
    // 获取数据列表
    getDataList() {
      this.dataListLoading = true
      this.$http({
        url: this.$http.adornUrl('/index/lunboList'),
        method: 'get',
        params: this.$http.adornParams({
          'page': 1,
          'limit': 5
        })
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.dataList = data.page.list
        } else {
          this.dataList = []
          this.totalPage = 0
        }
      })
    }
  }
}
</script>

<style scoped>
.index-page {
  text-align: center;
}
</style>
